runOnStartup(async runtime => {
    runtime.addEventListener("tick", () => tick())
    runtime.getLayout("MainLevel").addEventListener("afterlayoutstart", () => init())
});
function tick() {
    if (runtime.layout.name != "MainLevel") return;
    duckTouchChangeStatePoint.duckTouchSTATE()
}
function init() {
}
globalThis.duckTouchChangeStatePoint = {
    duckTouchSTATE: function () {
        for (let allDuck of runtime.objects.DuckObject.instances()) {
            if (allDuck.instVars.state == "go") {
                /**@type {ISpriteInstance} */
                let getDuck = allDuck
                let changeStatePoint = runtime.objects.duckChangeStatePoint.getFirstInstance()
                if (getDuck.testOverlap(changeStatePoint)) {
                    allDuck.instVars.state = "back"
                }
            }
        }
    }
}
export default duckTouchChangeStatePoint